<?php
namespace App\Services\SubmitForm;

use App\Services\ProjectValidate;
/**
 * SubmitForm模块验证规则集合
 *
 * Class ValidateSubmitForm
 */
class ValidateSubmitForm extends ProjectValidate
{
    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
//        if (!empty($initData['c_id'])) {
//            $this->rules['c_id']  = 'numeric|min:0';
//        }

    }
    
    public $rules = [
        'id'                => 'int|min:1',
        'app_id'            => 'int|min:1',
        'user_id'           => 'int|min:0',
        'name'              => 'min:2',
        'mobile'            => 'regex:/^1[34578][0-9]{9}$/',
        'content'           => 'min:2',
        'page'              => 'int|min:1',
        'listRows'          => 'integer|min:1|max:100'
    ];

   
    public $messages = [
       
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
      
    ];
}